<% label ||= nil %>
<% label_for_min_value ||= nil %>
<% action ||= 'change->auto-submit#submit' %>
<div class="mb-4 form-group">
  <div data-controller="better-slider" data-better-slider-label-for-min-value="<%= label_for_min_value %>" data-better-slider-unit-value="<%= unit %>">
    <label><%= label.presence || field.to_s.humanize %></label>
    <div class="flex flex-row w-full">
      <%= f.range_field field, class: "custom-range", min: min, max: max, step: 1, data: {'better-slider-target': 'rangeInput', action: action} %>
    </div>
    <span data-better-slider-target="currentValueLabel"></span>
  </div>
</div>
